import { ref, onMounted } from "vue";

const movies = () => {
  const list = ref([]);
  const getData = () => {
    fetch("http://www.pudge.wang:3080/api/rated/list")
      .then((response) => response.json())
      .then((res) => {
        list.value = res.result;
      });
  };
  onMounted(() => {
    getData();
  });

  return list;
};

export default movies;
